close all; 
clear clc; 
I=imread('E:\tuxiang_shiyan\zhiliao\Sample_Pictures\Desert2.jpg'); 
figure(1);
subplot(121);
imshow(I);
title('原始图像');
level = graythresh(I);
BW = im2bw(I, level);
subplot(122);
imshow(BW);
title('分割结果');
